// @algorithm @lc id=100275 lang=cpp
// @title shu-zu-zhong-zhong-fu-de-shu-zi-lcof

#include "algm/algm.h"
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
    int findRepeatNumber(vector<int> &nums) {
        sort(nums.begin(), nums.end());
        int cur, prev = -1;
        for (int i = 0; i < (int)nums.size(); ++i) {
            cur = nums[i];
            if (cur == prev) {
                return cur;
            }
            else {
                prev = cur;
            }
        }
        return -1;
    }
};